import request from '@/utils/request'

// 封装一个获取企业列表的接口
export const deptListAPI = () => {
  return request({
    url: '/company/department'
  })
}

// 封装一个做删除部门的接口
export const delDeptAPI = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 封装一个做添加部门的接口
export const addDeptAPI = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 封装一个做查看部门详情的接口
export const deptInfoAPI = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

// 封装一个做修改部门的接口
export const editDeptAPI = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
